<header class="bar bar-nav">  
    <a class="button button-link button-nav pull-left back" href="/mobile/apps/foods">
      <span class="icon icon-left"></span>
      返回
    </a>  
    <h1 class="title"><%= @order.order_number %>详情 (<%= @order.is_pay? %>)</h1>
</header>
<div class="content">
    
<div class="card facebook-card">
      
      <div class="card-content" style="padding:5px;">
        <table class="table table-border" style="width: 100%;text-align: center">
            <thead>
                <th>菜品名</th>
                <th>单价</th>
                <th>数量</th> 
                <th>总价</th>
            </thead>
            <tbody>
                <% @order.order_items.each do |item| %>
                <tr>
                   <td>
                       <%= item.food_name %>
                   </td> 
                   <td>
                       <%= item.single_price %>
                   </td>
                   <td>
                       <%= item.quantity %>个
                   </td>
                   <td>
                       <%= item.total_price %>
                   </td>
                </tr>
                <% end %>
            </tbody>            
        </table>
         <div class="card">
            <div class="card-content">
              <div class="card-content-inner">
                  <span class="pull-right">合计: <%= @order.total_price %>元</span>
                  <br>

                  <% if !@order.is_pay %>
                  <%= link_to("确认订单已支付", "/mobile/apps/foods/#{@order.id}/pay" , class: "button button-info button-fill") %>
                  <% end %>
                  <br>
                  <%= link_to("重新打印订单", "/mobile/apps/foods/#{@order.id}/print" , class: "button button-success button-fill") %>
              </div>
            </div>
          </div>
          
      </div>
      
    </div>

</div>